package com.dy.design_pattern_study.the_facade_pattern.dome1;

/**
 * @CreateBy zhangdingyi
 * @Date 2023-03-27
 * @Content
 */
public class Client {
    public static void main(String[] args) {

    }


    public static void fundAchieve() {
        Fund fund = new Fund();
        //直接购买
        fund.buyFund();
        //直接销售
        fund.sellFund();
    }

    /**
     * 耦合调用
     */
    public static void couplingUse() {
        NationalDebt1 nationalDebt1 = new NationalDebt1();
        Realty1 realty1 = new Realty1();
        Stock1 stock1 = new Stock1();
        Stock2 stock2 = new Stock2();
        Stock3 stock3 = new Stock3();

        //用户需要了解每个方法的具体使用，导致非常高的耦合性
        //买入
        nationalDebt1.buy();
        realty1.buy();
        stock1.buy();
        stock2.buy();
        stock3.buy();

        //抛售
        nationalDebt1.sell();
        realty1.sell();
        stock1.sell();
        stock2.sell();
        stock3.sell();
    }
}
